﻿using System;
using System.Collections.Generic;

namespace ElectronicCommerce.Framework.Caching
{
    public interface ICacheProvider
    {
        /// <summary>
        /// Default Expire Seconds
        /// </summary>
        int DefaultExpireSeconds { get; }

        /// <summary>
        /// Key 
        /// </summary>
        string KeyPreFix { get; }

        /// <summary>
        /// Name
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Max Elements In Cache
        /// </summary>
        int MaximumElementsInCache { get; }

        /// <summary>
        /// Number To Remove When Scavenging
        /// </summary>
        int NumberToRemoveWhenScavenging { get; }

        /// <summary>
        /// Insert
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="obj">value</param>
        void Insert(string key, object obj);

        /// <summary>
        /// Insert
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="obj">obj</param>
        /// <param name="defaultExpire">default expire</param>
        void Insert(string key, object obj, bool defaultExpire);

        /// <summary>
        /// Insert
        /// </summary>
        /// <param name="key">Key</param>
        /// <param name="obj">obj</param>
        /// <param name="seconds">Seconds</param>
        void Insert(string key, object obj, int seconds);

        /// <summary>
        /// Insert
        /// </summary>
        /// <param name="key">Key</param>
        /// <param name="obj">obj</param>
        /// <param name="dep">EcCacheDependency</param>
        void Insert(string key, object obj, ECCacheDependency dep);

        /// <summary>
        /// Insert
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="obj">obj</param>
        /// <param name="callBackFunction">Func CallBackFunction</param>
        void Insert(string key, object obj, Func<object> callBackFunction);

        /// <summary>
        /// Get
        /// </summary>
        /// <param name="key">Key</param>
        /// <returns>Object</returns>
        object Get(string key);

        /// <summary>
        /// Contains Cache Key
        /// </summary>
        /// <param name="key">Key</param>
        /// <returns>bool</returns>
        bool Contains(string key);

        /// <summary>
        /// Get Current Cache Items
        /// </summary>
        /// <returns>List ICacheItem</returns>
        List<ICacheItem> GetCurrentCacheItems();

        /// <summary>
        /// Clear Cache
        /// </summary>
        void Clear();

        /// <summary>
        /// Remove Cache Key
        /// </summary>
        /// <param name="key">Keys</param>
        void Remove(string key);

        /// <summary>
        /// Remove By Pattern
        /// </summary>
        /// <param name="pattern">pattern</param>
        void RemoveByPattern(string pattern);

        /// <summary>
        /// Check Performance
        /// </summary>
        void CheckPerformance();


    }
}
